// component/custom-tab-bar/index.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        selected: Number, // 当前选中的分页索引
        showRedPoint:Number,
    },

    /**
     * 组件的初始数据
     */
    data: {
        selected: 0, //当前选中的tab下标
        color: "rgba(0,0,0,0.2500)",
        selectedColor: "#FF554C", //选中的自提
        list: [{
            "pagePath": "/pages/index/index",
            "iconPath": "http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/home-unselect.png",
            "selectedIconPath": 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/home-selects.png',
            "text": "首页"
        },
        // {
        //     "pagePath": "/pages/discovery/index",
        //     "iconPath": "http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/discover-unselect.png",
        //     "selectedIconPath": ' http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/discover-select.png',
        //     "text": "发现",

        // },
        // {
        //     "pagePath": "/pages/draw/drawList/index",
        //     "iconPath": "http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/draw-unselect.png",
        //     "selectedIconPath": 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/draw-select.png',
        //     "text": "抽奖",

        // },

        {
            "pagePath": "/pages/crowd/List/index",
            "iconPath": "http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/draw-unselect.png",
            "selectedIconPath": 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/draw-select.png',
            "text": "团购",

        },
        {
            "pagePath": "/pages/sys/sys",
            "iconPath": "",
            "selectedIconPath": '',
            "text": "扫一扫",
            // diyClass:"diy",
            // textClass:'textClass'
        },
           {
            "pagePath": "/pages/message/message",
            "iconPath": "http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/message-unselect.png",
            "selectedIconPath": 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/messages-select.png',
            "text": "消息"
        },
        // {
        //     "pagePath": "/packageB/pages/Activity/Index/index",
        //     "iconPath": "http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/activeNoselect.png",
        //     "selectedIconPath": 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/activeSelect.png',
        //     "text": "活动"
        // },
        {
            "pagePath": "/pages/mySelf/Index/index",
            "iconPath": "http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/my-unselects.png",
            "selectedIconPath": 'http://feiyangimage.oss-cn-shanghai.aliyuncs.com/wxApplets/icon/my-selects.png',
            "text": "我的"
        }
        ], //tabber循环数据集

    },

    attached() {

    },
    methods: {
        switchTab(e) {
            const data = e.currentTarget.dataset;
            const url = data.path
            console.log(url, "6666666666")
            console.log(data.index, "8844446666")
            this.setData({
                selected: data.index
            })
            wx.redirectTo({
                url,
            })
        }
    },
})